const { ethers } = require("hardhat");
async function main() {
  try {
    // 获取默认账户
    const [deployer] = await ethers.getSigners();
    console.log("Deploying contracts with the account:", deployer.address);

    // 获取 DZPToken 合约工厂
    const DZPToken = await ethers.getContractFactory("DZPToken");

    // 部署 DZPToken 合约，传入 feeReceiver 参数
    const feeReceiver = deployer.address; // 或者你可以传入其他地址
    const token = await DZPToken.deploy(feeReceiver);
    // 等待合约部署完成
    await token.waitForDeployment();
    // 输出合约地址
    console.log("DZPToken deployed to:", token.target);
  } catch (error) {
    console.error("Error deploying contract:", error);
  }
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });
